package cn.thornbird.orgsync.service;

import cn.thornbird.orgsync.entity.Task;
import cn.thornbird.orgsync.entity.TaskDetail;
import cn.thornbird.orgsync.exception.BadRequestException;
import cn.thornbird.orgsync.exception.ForbiddenException;
import cn.thornbird.orgsync.exception.NotFoundException;
import cn.thornbird.orgsync.model.PageList;
import cn.thornbird.orgsync.model.UserData;
import cn.thornbird.orgsync.model.combined.TaskObject;
import cn.thornbird.orgsync.vo.record.TaskRecord;
import cn.thornbird.orgsync.vo.request.TaskDetailQueryRequest;
import cn.thornbird.orgsync.vo.request.TaskQueryRequest;

public interface TaskService {

    TaskObject find(UserData userData, String id) throws ForbiddenException, NotFoundException;

    PageList<TaskDetail> getTaskDetails(UserData userData, String taskId, TaskDetailQueryRequest taskDetailQueryRequest,
                                        Integer pageNumber, Integer pageSize)
            throws ForbiddenException, NotFoundException;

    PageList<TaskObject> query(UserData userData, TaskQueryRequest taskQueryRequest,
                               Integer pageNumber, Integer pageSize);

    TaskObject save(UserData userData, TaskRecord taskRecord)
            throws BadRequestException, ForbiddenException, NotFoundException;

    TaskObject delete(UserData userData, String id) throws BadRequestException, ForbiddenException, NotFoundException;

    void generateTaskDetails();

    void runTaskDetails();

}
